#include <STC89C5xRC.H>
#include <INTRINS.H>
#include "dsq.h"
#include "dlaj.h"
	unsigned int num=0;
	
void main()
{
		P2 = 0xfe;
		dsq();
	while (1)
	{
		if ( dlaj()== 1)
		{
			num++;
			if (num >= 2)
			{
				num = 0;
			}
		}
		
	}

}


void qths()  interrupt 1
{
	static unsigned int a = 0;
	TH0 = 64536 / 256;
	TL0 = 64536 % 256;
	a++;
	if (a == 1000)
	{
		a = 0;
		if (num == 0)
		{
			P2 = _crol_(P2, 1);
		}
		if (num == 1)
		{
			P2 = _cror_(P2, 1);
		}
	}
}

